QLibrary/Unix: do not attempt to load a library relative to $PWD
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Thu, 30 Jan 2020 21:03:38 +0000 (21:03 +0000)
committerDmitry Shachnev <mitya57@debian.org>
Thu, 30 Jan 2020 21:03:38 +0000 (21:03 +0000)
commit0294f5e18f2a674b272a7b468a79db8bab8eb8fe
tree0e77f0a148f10d598e9bdb96b463cc7a18d7a633
parentc04ca40e4c15c5b736aef892289e232016002f20
QLibrary/Unix: do not attempt to load a library relative to $PWD

Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=e6f1fde24f77f63f
Last-Update: 2020-01-30

I added the code in commit 5219c37f7c98f37f078fee00fe8ca35d83ff4f5d to
find libraries in a haswell/ subdir of the main path, but we only need
to do that transformation if the library is contains at least one
directory separator. That is, if the user asks to load "lib/foo", then we
should try "lib/haswell/foo" (often, the path prefix will be absolute).

When the library name the user requested has no directory separators, we
let dlopen() do the transformation for us. Testing on Linux confirms
glibc does so:

$ LD_DEBUG=libs /lib64/ld-linux-x86-64.so.2 --inhibit-cache ./qml -help |& grep Xcursor
   1972475:     find library=libXcursor.so.1 [0]; searching
   1972475:       trying file=/usr/lib64/haswell/avx512_1/libXcursor.so.1
   1972475:       trying file=/usr/lib64/haswell/libXcursor.so.1
   1972475:       trying file=/usr/lib64/libXcursor.so.1
   1972475:     calling init: /usr/lib64/libXcursor.so.1
   1972475:     calling fini: /usr/lib64/libXcursor.so.1 [0]

Gbp-Pq: Name CVE-2020-0570.diff
src/corelib/plugin/qlibrary_unix.cpp